package com.ruoyi.wms.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.wms.mapper.WmsScrapSummaryMapper;
import com.ruoyi.wms.domain.WmsScrapSummary;
import com.ruoyi.wms.service.IWmsScrapSummaryService;
import com.ruoyi.common.core.text.Convert;

/**
 * 报废汇总Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-02-15
 */
@Service
public class WmsScrapSummaryServiceImpl implements IWmsScrapSummaryService 
{
    @Autowired
    private WmsScrapSummaryMapper wmsScrapSummaryMapper;

    /**
     * 查询报废汇总
     * 
     * @param id 报废汇总主键
     * @return 报废汇总
     */
    @Override
    public WmsScrapSummary selectWmsScrapSummaryById(Long id)
    {
        return wmsScrapSummaryMapper.selectWmsScrapSummaryById(id);
    }

    /**
     * 查询报废汇总列表
     * 
     * @param wmsScrapSummary 报废汇总
     * @return 报废汇总
     */
    @Override
    public List<WmsScrapSummary> selectWmsScrapSummaryList(WmsScrapSummary wmsScrapSummary)
    {
        return wmsScrapSummaryMapper.selectWmsScrapSummaryList(wmsScrapSummary);
    }

    /**
     * 新增报废汇总
     * 
     * @param wmsScrapSummary 报废汇总
     * @return 结果
     */
    @Override
    public int insertWmsScrapSummary(WmsScrapSummary wmsScrapSummary)
    {
        wmsScrapSummary.setCreateTime(DateUtils.getNowDate());
        return wmsScrapSummaryMapper.insertWmsScrapSummary(wmsScrapSummary);
    }

    /**
     * 修改报废汇总
     * 
     * @param wmsScrapSummary 报废汇总
     * @return 结果
     */
    @Override
    public int updateWmsScrapSummary(WmsScrapSummary wmsScrapSummary)
    {
        wmsScrapSummary.setUpdateTime(DateUtils.getNowDate());
        return wmsScrapSummaryMapper.updateWmsScrapSummary(wmsScrapSummary);
    }

    /**
     * 批量删除报废汇总
     * 
     * @param ids 需要删除的报废汇总主键
     * @return 结果
     */
    @Override
    public int deleteWmsScrapSummaryByIds(String ids)
    {
        return wmsScrapSummaryMapper.deleteWmsScrapSummaryByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除报废汇总信息
     * 
     * @param id 报废汇总主键
     * @return 结果
     */
    @Override
    public int deleteWmsScrapSummaryById(Long id)
    {
        return wmsScrapSummaryMapper.deleteWmsScrapSummaryById(id);
    }
}
